#ifndef _NOTE_FILTER_H
#define _NOTE_FILTER_H

#define NOTE_FILTER_DEFAULT_MAX 30

#include <wx/string.h>
#include <vector>
class Note;


class NoteFilter
{
    bool MatchesKeywords(const wxString& txt) const;
public:
    std::vector<wxString> keywords;
    wxString from_date;
    wxString to_date;
    wxString body;
    long max_notes;

    NoteFilter(long max_notes) {
        wxASSERT(max_notes > 0);
        this->max_notes = max_notes;
    }
    NoteFilter(const wxString& from_date=L"", const wxString& to_date=L"", const wxString& body=L"", long max_notes=NOTE_FILTER_DEFAULT_MAX) {
        wxASSERT(max_notes > 0);
        this->from_date = from_date;
        this->to_date = to_date;
        this->body = body;
        this->max_notes = max_notes;
        wxASSERT(max_notes > 0);
    }
/*    NoteFilter(const std::vector<wxString>& keywords, const wxString& from_date=wxT(""), const wxString& to_date=wxT(""), const wxString& body=wxT("")) {
        this->keywords = keywords;
        this->from_date = from_date;
        this->to_date = to_date;
        this->body = body;
    }*/
    static bool CheckKeywordsString(const wxString& from);
    bool KeywordsFromString(const wxString& from);
    wxString KeywordsToString() const;

    wxString ToString() const;
    bool Matches(const Note& n) const;
};
bool CheckFilterDate(const wxString& from);

#endif
